Skip to content

fix(nuxt): Fix db0 and Cloudflare span data, run nuxt-4 on Bun, Deno and Cloudflare - #26285

Open
sentry-junior[bot] wants to merge 8 commits into
developfrom
feat/nuxt-4-runtime-variants
Open

sentry-junior[bot] wants to merge 8 commits into
developfrom
feat/nuxt-4-runtime-variants

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Why: Runs the nuxt-4 suite on Node, Bun, Deno and Cloudflare from one app, following #24598 (runtime matrix key, runtime files, README convention), and folds nuxt-4-cloudflare into it. @sentry/nuxt bundles sentry.server.config.ts into the Nitro output, so Bun and Deno start .output/server/index.mjs with no preload. Their runtime config files add the @sentry/bun / @sentry/deno integrations, the same way nextjs-16 does. The Cloudflare variants test the documented Cloudflare setup: they build with cloudflare_module, set up the SDK with sentryCloudflareNitroPlugin, and delete sentry.server.config.ts before nuxt build, because a runtime file can replace a file but not remove it. Without that file the module adds no db0, storage, cache or middleware instrumentation, so those tests skip on Cloudflare with that reason. New tests cover per-request isolation, incoming trace continuation, outgoing fetch with sentry-trace/baggage, logs, and POST errors. Where runtimes really differ, the suite branches on RUNTIME and says why in a comment.

SDK changes the variants surfaced. They change what users see:

  • @sentry/nuxt, user-visible: db0 spans set db.system.name from the connector's dialect (mysql, postgresql, sqlite) instead of the connector name. For example, mysql2 and planetscale become mysql, and better-sqlite3, cloudflare-d1 and bun-sqlite become sqlite. This follows the OTel conventions, but saved queries, alerts and dashboards that filter on the old values need updating, so CHANGELOG.md has an entry under Important Changes.
  • @sentry/nuxt: db0 spans on bun-sqlite/node-sqlite get db.namespace, and errors that eager connectors (bun-sqlite, better-sqlite3) throw from prepare are captured.
  • @sentry/nuxt on Cloudflare: the module adds the page route detector without a server config too, so page server spans are named after their route (GET /test-param/:param()). Before, they were named GET only. Error events of a request get a transaction name (GET /api/...), as node:http gives them on Node.
  • @sentry/server-utils: the orchestrion CommonJS interop unwraps Bun's namespaces of CommonJS function exports. It only does so when every key mirrors the function, so an ES module that exports a name next to its default function keeps its named exports.

Runtime differences the suite asserts as they are, not as defects: Worker origin is auto.http.cloudflare. The Worker build is minified. On Deno, a startup crash exits 0. The mongoose route is a stub on Cloudflare, because Nitro's Cloudflare preset can't bundle the mongodb driver even without Sentry (its optional require('@aws-sdk/credential-providers') fails with "externals are not allowed").

Split out, not fixed here:

  1. Cloudflare managed tunnel on Nuxt 4 (Nitro v2) is not served (#26364). nuxt-4 (tunnel-basepath-cloudflare) stays optional. sentryCloudflareNitroPlugin passes the request body only if isServedTunnelRequest() matches, and it runs before wrapRequestHandler creates the per-request client. So it never matches, the body is dropped, and the app answers the tunnel (here 401 from the auth middleware). It fails the same with the documented setup (no server config). Passing the body for every request makes the tunnel tests pass, but tunnel-request-body.test.ts then shows that the body of other POSTs ends up on their error events. A fix needs a design call on matching the tunnel before the client exists, so it gets its own PR. The deleted nuxt-4-cloudflare tunnel test did not cover this: built from develop, its tunnel POST got a 200 HTML page from app.vue and forwarded nothing, so it passed without the tunnel answering.
  2. Cloudflare meta-tag baggage has no sentry-transaction. The plugin reads the trace data when the request starts, before the route is known.
  3. Deno startup crash exits 0. The SDK's onUnhandledRejection (mode warn) catches module-evaluation errors, which Deno routes to unhandledRejection.

How to review: Start with tests/runtime.ts and the RUNTIME branches, then nuxt.config.ts, cloudflare/sentry.ts and the Cloudflare build scripts in package.json. The SDK changes are small, each with unit or e2e tests.

Unsure about: No required check covers the Cloudflare managed tunnel until #26364 is fixed. The old required test did not cover it either (see above).

Closes #24838

Local runs and CI

Local runs on the latest commit's SDK tarballs:

  • Node test:assert: 82 passed, 3 skipped (prod). 7 passed, 1 skipped (dev).
  • Cloudflare (wrangler dev, no server config): 46 passed, 39 skipped (tunnel-only tests, the instrumentation that needs a server config, process spawning, mongoose, Node-only build checks)
  • Cloudflare tunnel-basepath (no server config): 1 passed, 2 failed (defect 1)
  • @sentry/nuxt unit tests: 476 passed, 1 failed. test/vite/sourceMaps-nuxtHooks.test.ts fails on develop too. @sentry/server-utils orchestrion tests: 185 passed. lint:types of both packages and oxlint pass.

Bun and Deno were not run locally for this commit. Earlier local runs gave Bun 82 passed and Deno 2.9.0 82 passed, 3 skipped each. CI covers them.

via Isaac Schlueter.

--

View Session [Sentry]

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: ad4bbc3 (PR test merge using develop at 075093d)

Against: 075093d (develop) · base run #66039

✅ Baseline matches: this diff contains only this PR's changes.

Path Size % Change Change
@sentry/browser 30.1 kB - -
@sentry/browser - with treeshaking flags 28.3 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 28.2 kB - -
@sentry/browser (incl. Tracing) 52.28 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 52.29 kB - -
@sentry/browser (incl. Tracing, Profiling) 55.25 kB - -
@sentry/browser (incl. Tracing, Replay) 92.82 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 81.6 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 97.21 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 110.6 kB - -
@sentry/browser (incl. Feedback) 47.73 kB - -
@sentry/browser (incl. sendFeedback) 30.69 kB - -
@sentry/browser (incl. FeedbackAsync) 35.69 kB - -
@sentry/browser (incl. Metrics) 31.43 kB - -
@sentry/browser (incl. Logs) 31.71 kB - -
@sentry/browser (incl. Metrics & Logs) 32.37 kB - -
@sentry/react 32.11 kB - -
@sentry/react (incl. Tracing) 54.95 kB - -
@sentry/vue 38.3 kB - -
@sentry/vue (incl. Tracing) 55.24 kB - -
@sentry/svelte 30.12 kB - -
@sentry/remix (Remix 3 client bundle) 58.06 kB - -
CDN Bundle 31.87 kB - -
CDN Bundle (incl. Tracing) 52.7 kB - -
CDN Bundle (incl. Logs, Metrics) 34.67 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 55.26 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 75.7 kB - -
CDN Bundle (incl. Tracing, Replay) 90.72 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 93.33 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 96.09 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 98.69 kB - -
CDN Bundle - uncompressed 92.98 kB - -
CDN Bundle (incl. Tracing) - uncompressed 155.45 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 101.33 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 163.08 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 231.44 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 275.61 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 283.24 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 287.4 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 295.02 kB - -
@sentry/nextjs (client) 58.37 kB - -
@sentry/sveltekit (client) 53.48 kB - -
@sentry/core/server 44.65 kB - -
@sentry/core/browser 14.3 kB - -
@sentry/node 150.23 kB -0.01% -7 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.3 kB - -
@sentry/node - without tracing 88.47 kB -0.01% -8 B 🔽
@sentry/node - without channel injection 139.17 kB -0.01% -3 B 🔽
@sentry/aws-serverless 98.36 kB -0.01% -4 B 🔽
@sentry/cloudflare (withSentry) - minified 204.55 kB - -
@sentry/cloudflare (withSentry) 474.76 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 229.86 kB - -

View base workflow run

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Optional E2E tests

Some optional checks were not successful. They do not block the merge. 5 not successful, 56 successful. See the run.

Check Status
❌ CI: Optional E2E Tests / E2E node-eve (orchestrion) Test (optional) Failing after 2m Details
❌ CI: Optional E2E Tests / E2E node-eve Test (optional) Failing after 2m Details
❌ CI: Optional E2E Tests / E2E nuxt-4 (tunnel-basepath-cloudflare) Test (optional) Failing after 1m Details
❌ CI: Optional E2E Tests / E2E node-eve (latest) Test (optional) Failing after 2m Details
❌ CI: Optional E2E Tests / E2E nextjs-16-cacheComponents (cloudflare) Test (optional) Failing after 11m Details
Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E astro-7 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries Test (optional) Successful in 45s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (deno) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-think Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (cloudflare, latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (cloudflare) Test (optional) Successful in 39s Details
✅ CI: Optional E2E Tests / E2E node-flue (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (latest) Test (optional) Successful in 46s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-flue-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E astro-7-static Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-agent Test (optional) Successful in 46s Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions Test (optional) Successful in 27s Details
✅ CI: Optional E2E Tests / E2E cloudflare-workers-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable (latest) Test (optional) Successful in 47s Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 Test (optional) Successful in 33s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v1 Test (optional) Successful in 24s Details
✅ CI: Optional E2E Tests / E2E cloudflare-think (ai v6) Test (optional) Successful in 58s Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions (latest) Test (optional) Successful in 42s Details
✅ CI: Optional E2E Tests / E2E deno (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-cloudflare Test (optional) Successful in 43s Details
✅ CI: Optional E2E Tests / E2E cloudflare-mastra Test (optional) Successful in 55s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 33s Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 (tracer provider) Test (optional) Successful in 41s Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (tunnel-dev) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (latest) Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E node-pi-durable Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-flue Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable Test (optional) Successful in 53s Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 Test (optional) Successful in 49s Details
✅ CI: Optional E2E Tests / E2E debug-id-sourcemaps Test (optional) Successful in 49s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 43s Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (kv-cache) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E supabase-nextjs Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E react-send-to-sentry Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E node-mastra Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 35s Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry-static Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-pi-durable (latest) Test (optional) Successful in 34s Details
✅ CI: Optional E2E Tests / E2E node-mastra (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-orpc Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-14 (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E solidstart-2 Test (optional) Successful in 59s Details
✅ CI: Optional E2E Tests / E2E react-router-7-framework-instrumentation Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E vue-3 (no Options API) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (latest) Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) Successful in 40s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps Test (optional) Successful in 31s Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (cloudflare) Test (optional) Successful in 39s Details

@isaacs isaacs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The title is test(e2e), but the PR changes released SDK behavior in @sentry/nuxt and @sentry/server-utils. The changelog comes from PR titles, so these changes would not show up there. The db.system.name change in packages/nuxt/src/runtime/utils/instrumentDatabase.ts line 77 is visible to users. Spans that had mysql2, planetscale, cloudflare-d1, better-sqlite3 or pglite now report mysql, sqlite or postgresql. That is correct by the OTel conventions, but it can break saved queries, alerts and dashboards that filter on the old values. Removing the sentry.server plugin on Cloudflare and the new transaction name on Cloudflare error events also change what users see.

Suggestion: Move the SDK changes into one or more fix(nuxt) / fix(server-utils) PRs that land first, with a changelog line for the db.system.name change. Then this PR stays a pure test(e2e) change. If splitting costs too much, at least retitle to fix(nuxt): ... and list the SDK changes in the description and the changelog.


The runtime-matrix approach is good. One app for four runtimes, with RUNTIME branches that each give a reason, is easier to maintain than separate apps. The new server tests (isolation, trace continuation, outgoing fetch propagation, logs) add coverage that had real gaps. The Bun and Deno setup follows the nextjs-16 convention and the README explains it well. The prepare-throws capture and the dialect-based db.system.name are correct fixes.

Concern 1 blocks the merge. The Cloudflare variant tests a setup that the SDK warns against, so its green result covers instrumentation that documented Cloudflare users do not get. It also seems to be the reason for the nitroServer.ts change, and maybe for the tunnel failure. Concerns 2 and 3 depend on how concern 1 is resolved. Concern 4 is a small but real correctness risk in code that runs on every runtime. It has a simple fix.

Comment thread packages/nuxt/src/vite/nitroServer.ts Resolved
@sentry-junior sentry-junior Bot changed the title test(e2e): Add Bun, Deno and Cloudflare variants to nuxt-4 fix(nuxt): Fix db0 and Cloudflare span data, run nuxt-4 on Bun, Deno and Cloudflare Nov 13, 2026
@sentry-junior

sentry-junior Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Changes for the review body:

  • I retitled the PR to fix(nuxt): Fix db0 and Cloudflare span data, run nuxt-4 on Bun, Deno and Cloudflare, so the SDK changes reach the changelog.
  • CHANGELOG.md has an Important Changes entry for the db.system.name change. It names the old and new values and says to update saved queries, alerts and dashboards.
  • The description lists every SDK change and marks the db.system.name one as user-visible.
  • I didn't split into separate PRs. The e2e variants only go green with the fixes, so a pure test(e2e) PR would have to wait on them anyway.
  • The Cloudflare sentry.server plugin removal is reverted (see the nitroServer.ts thread).
  • The variants now test the documented Cloudflare setup. That surfaced one more SDK fix: page server spans on Cloudflare were named only GET. The module now adds the route detector without a server config too.

@isaacs
isaacs marked this pull request as ready for review November 13, 2026 15:26
@isaacs
isaacs requested review from a team and isaacs November 13, 2026 15:26
@isaacs

isaacs commented Nov 13, 2026

Copy link
Copy Markdown
Member

bugbot run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

sentry-junior Bot and others added 7 commits November 13, 2026 17:05
Runs the nuxt-4 suite on Node, Bun, Deno and Cloudflare from one app,
following react-router-8-framework, and folds nuxt-4-cloudflare into it.

Fixes the SDK defects the variants surfaced: db0 spans and prepare errors
on bun-sqlite, Bun CommonJS namespaces in the orchestrion interop, and on
Cloudflare the missing transaction name of request events and the tracing
meta tags on cached HTML.

Ref #24838

Co-Authored-By: Isaac Schlueter <isaac.schlueter@sentry.io>
…and require the runtime variants

The Vite server variant builds no server/ directory, like the other server
route tests note. Bun, Deno and Cloudflare passed in CI, so they move to the
required variants. The Cloudflare tunnel variant stays optional.

Co-Authored-By: Isaac Schlueter <isaac.schlueter@sentry.io>
With a server config, the module adds the sentry.server plugin on every
preset. On Cloudflare, sentryCloudflareNitroPlugin already adds the page
meta tags, so cached pages got two sentry-cache-origin tags.
…r too

The prerenderer is built from the original config with the nitro-prerender
preset, so pre-rendered pages still got both plugins' meta tags.
…he function

An ES module with a default function and a named `name` export matched the
Bun check and lost its named exports.

Co-Authored-By: Isaac Schlueter <isaac.schlueter@sentry.io>
…setup

The Cloudflare variant now builds without sentry.server.config.ts, as the
Cloudflare setup documents. Without it the module added no route detector,
so page server spans were named after the method only. The module now adds
it on both setups. This makes the Cloudflare-only removal of the
sentry.server plugin unneeded, so it is reverted.

Co-Authored-By: Isaac Schlueter <isaac.schlueter@sentry.io>
@isaacs
isaacs force-pushed the feat/nuxt-4-runtime-variants branch from daf5de9 to 32ee1da Compare November 13, 2026 16:05

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 32ee1da. Configure here.

@isaacs
isaacs added this pull request to stack #26366 November 13, 2026 16:15
@isaacs

isaacs commented Nov 13, 2026

Copy link
Copy Markdown
Member

Remaining issue will be addressed by #26365, next in the stack.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run the Nuxt e2e suite on Bun, Deno and Cloudflare from one app

1 participant